function ccR_Warlock_Imp_Flee()
	if ccR.Player.Has.Spell(FLEE)
	and ccR.Spell.Is.Ready(FLEE)
	and ccR.Pet.IsAlive()
	and ccR.Pet.Distance("player") <= 38
	then
		local eventIndex = C_LossOfControl.GetNumEvents()
		while (eventIndex > 0) do
			local _, _, text = C_LossOfControl.GetEventInfo(eventIndex)
			if text == LOSS_OF_CONTROL_DISPLAY_ROOT 
			or text == LOSS_OF_CONTROL_DISPLAY_SNARE
			or text == LOSS_OF_CONTROL_DISPLAY_STUN_MECHANIC
			or text == LOSS_OF_CONTROL_DISPLAY_STUN
			then
				ccR.Cast(FLEE)
				return
			end
			eventIndex = eventIndex - 1
		end
	end
end

function ccR_Warlock_Cauterize_Master()
	if ccR.Player.Has.Spell(CAUTERIZE_MASTER)
	and ccR.Spell.Is.Ready(CAUTERIZE_MASTER)
	and ccR.Player.Health() <= 85
	and ccR.Pet.IsAlive()
	and ccR.Pet.Distance() <= 38
	then
		ccR.Cast(CAUTERIZE_MASTER)
		return
	end
	return
end